<template>
  <div class="flex-row" style="align-items: center">
    <i v-if="icon.includes('el-icon')" :class="[icon, 'sub-el-icon']" />
    <svg-icon v-else :icon-class="icon" />
<!--    <i class="border-left"/>-->
    <span v-if="title" slot="title">{{ title }}</span>
    <span v-if="subtitle" slot="subtitle" class="subtitle">{{ subtitle }}</span>
<!--    <el-button type="primary" class="dialog-close" icon="el-icon-close" @click="isClose" />-->
    <i class="el-icon-close dialog-close" @click="isClose"/>
  </div>
</template>
<script>
export default {
  name: 'DialogTitle',
  // functional: true,
  props: {
    icon: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    },
    subtitle: {
      type: String,
      default: ''
    },
    isClose: {
      type: Function,
      default: () => {}
    }
  }
}
</script>

<style lang="scss" scoped>
.sub-el-icon {
  color: $base-color-default;
  font-size: 20px;
  font-weight: bold;
}
span {
  //padding-left: 10px;
  font-size: 16px;
  line-height: 1.67;
  font-weight: 600;
  color: #FFFFFF;
}
.subtitle {
  line-height: 1.25;
  font-size: 14px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 2px solid #FFFFFF;
}
.border-left {
  display: inline-block;
  width: 5px;
  border-radius: 2.5px;
  height: 15px;
  background: $base-color-default;
}
.dialog-close {
  position: absolute;
  right: 20px;
  color: #FFFFFF;
  cursor: pointer;
}
.el-button {
  padding: 8px;
  box-shadow: 0 8px 16px 0 rgb(35 45 65 / 28%);
}
</style>
